//
//  HeadView.m
//  Project_B
//
//  Created by 王涛 on 15/12/16.
//  Copyright © 2015年 王涛. All rights reserved.
//

#import "HeadView.h"
#define kWidth [UIScreen mainScreen].bounds.size.width
#define kHeight [UIScreen mainScreen].bounds.size.height
@implementation HeadView

- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        
        self.weatherImageView = [[UIImageView alloc] initWithFrame:(CGRectMake(10, 10, 70, 65))];
        self.weatherImageView.image = [UIImage imageNamed:@"air1.png"];
        [self addSubview:self.weatherImageView];
        
        self.temperatureLabel = [[UILabel alloc] initWithFrame:(CGRectMake(80, 28, 100, 25))];
        self.temperatureLabel.text = @"0° ~ 7°";
        self.temperatureLabel.font = [UIFont boldSystemFontOfSize:26];
        self.temperatureLabel.tintColor = [UIColor darkGrayColor];
        [self addSubview:self.temperatureLabel];
        
        UIImageView *imageView = [[UIImageView alloc]initWithFrame:(CGRectMake(270, 20, 85, 70))];
        imageView.image = [UIImage imageNamed:@"air.png"];
        imageView.layer.borderWidth = 1;
        imageView.layer.cornerRadius = 5;
        imageView.layer.borderColor = [[UIColor lightGrayColor] CGColor];
        [self addSubview:imageView];
        
        self.airLabel = [[UILabel alloc] initWithFrame:(CGRectMake(270, 45, 85, 40))];
        self.airLabel.textColor = [UIColor redColor];
        self.airLabel.textAlignment = NSTextAlignmentCenter;
        self.airLabel.text = @"60";
        self.airLabel.font = [UIFont boldSystemFontOfSize:25];
        self.airLabel.textColor = [UIColor redColor];
        [self addSubview:self.airLabel];
        
        self.xicheLabel = [[UILabel alloc] initWithFrame:(CGRectMake(20, 75, 135, 20))];
        self.xicheLabel.font = [UIFont systemFontOfSize:14];
        self.xicheLabel.textColor = [UIColor lightGrayColor];
        self.xicheLabel.text = @"较适宜洗车｜多云";
        
        [self addSubview:self.xicheLabel];

        self.addressLabel = [[UILabel alloc] initWithFrame:(CGRectMake(20, 110, 80, 25))];
        self.addressLabel.text = @"上海";
        self.addressLabel.textColor = [UIColor lightGrayColor];
        self.addressLabel.font = [UIFont systemFontOfSize:15];
        [self addSubview:self.addressLabel];
        
        self.dateLabel = [[UILabel alloc] initWithFrame:(CGRectMake(270, 110, 90, 25))];
        self.dateLabel.text = @"12/17 星期四";
        self.dateLabel.font = [UIFont systemFontOfSize:15];
        self.dateLabel.textColor = [UIColor lightGrayColor];
        [self addSubview:self.dateLabel];
    }
    return self;
}

@end
